New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gRPC-Web client and server #695
Conversation
src/Grpc.AspNetCore.Server/Internal/CallHandlers/ServerCallHandlerBase.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still taking a look at the base64 pipereader/writer and request/responsestream
I've build it from the sources to use in my Blazor client side app and I get the following error: WASM: Status(StatusCode=Internal, Detail="Error starting gRPC call: Cannot invoke method because it was wiped. See stack trace for details.") Is this a problem related to this pr or am I implementing something wrong? |
Instead of passing var wasmHttpMessageHandlerType = Assembly.Load("WebAssembly.Net.Http").GetType("WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler");
var wasmHttpMessageHandler = (HttpMessageHandler)Activator.CreateInstance(wasmHttpMessageHandlerType); |
ed061a8
to
9b76a0b
Compare
9b76a0b
to
81fc1b1
Compare
Thanks @JamesNK, that seems to work, I no longer get the cannot invoke error. I get another error now: WASM: Status(StatusCode=Internal, Detail="Error starting gRPC call: Buffer is not large enough for header") Using this code:
Any idea on this? Again I'm not sure if its related to the pr as I'm implementing in a similar way as the tests in the .web projects. |
Ohh, I forgot that I modified the client slightly. You'll need to also compile and use Grpc.Net.Client. |
That fixed it! Thanks a lot. |
Thanks - will be fixed with dotnet/blazor#1960 (as in, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments for the request/responsestreams. I'll finish up with the pipewriter/reader tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial set of comments, overall things are looking good but let's discuss the next steps in our sync-up.
Sorry for the delay.
/// Written to as closely as possible mirror the behaviour of the C++ implementation in grpc/grpc-web: | ||
/// https://github.com/grpc/grpc-web/blob/92aa9f8fc8e7af4aadede52ea075dd5790a63b62/net/grpc/gateway/examples/echo/echo_service_impl.cc | ||
/// </summary> | ||
public class EchoService : Grpc.Gateway.Testing.EchoService.EchoServiceBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you have a copy of the same service at testassets/FunctionalTestsWebsite/Services/EchoService.cs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That's so it is tested by CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good enough as a preview implementation of the grpc-web functionality. LGTM, thanks for incorporating all the comments.
This will be in the next release as preview for people to test it out and provide feedback/report issues, but there won't be "stable" nuget packages yet.
The next steps and release criteria for official release will be driven by grpc/proposal#169.
🎈 🎉 🍰 |
Hi, great work @JamesNK. Would you be interested in adding this implementation to the grpc-web compatibility tests I'm running? See https://github.com/johanbrandhorst/grpc-web-compatibility-test |
That's one hell of a serious pull request... grpc port to .net core paradigm, very much appreciate your work, thanks a ton... looking forward using it in our next project... |
Fixes #99
Implementation of https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md for ASP.NET Core server and .NET Core gRPC client.